projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
08f68cc
)
composetable: Limit algorithmic checking
author
Matthias Clasen
<mclasen@redhat.com>
Fri, 26 Mar 2021 23:48:41 +0000
(19:48 -0400)
committer
Matthias Clasen
<mclasen@redhat.com>
Sat, 27 Mar 2021 00:27:55 +0000
(20:27 -0400)
Only check for combinations of up to 2 dead keys with
a base character. We don't want to spend ages generating
all permutations of long sequences.
gtk/gtkcomposetable.c
patch
|
blob
|
history
diff --git
a/gtk/gtkcomposetable.c
b/gtk/gtkcomposetable.c
index fb5ab6abe6e2dd175e8c81cb391e6c2a591e5f2f..7aa9792e3bb7339d6079e7cb5d6311258385f5a3 100644
(file)
--- a/
gtk/gtkcomposetable.c
+++ b/
gtk/gtkcomposetable.c
@@
-1190,6
+1190,12
@@
gtk_check_algorithmically (const guint16 *compose_buffer,
for (i = 0; i < n_compose && IS_DEAD_KEY (compose_buffer[i]); i++)
;
+
+ /* Allow at most 2 dead keys */
+ if (i > 2)
+ return FALSE;
+
+ /* Can't combine if there's no base character */
if (i == n_compose)
return TRUE;